---
layout: m1x_soap
title: Category Move
---



<h2><a name="catalog_category.move-Module%3AMageCatalog"></a>Module: Mage_Catalog</h2>

<p>The Mage_Catalog module allows you to manage categories and products.</p>

<h4><a name="catalog_category.move-ResourceName%3Acatalogcategory"></a>Resource Name: catalog_category</h4>

<p><b>Aliases:</b></p>
<ul>
	<li>category</li>
</ul>


<h5><a name="catalog_category.move-Method%3A"></a>Method:</h5>

<ul>
	<li>catalog_category.move (SOAP V1)</li>
	<li>catalogCategoryMove (SOAP V2)</li>
</ul>


<p>Allows you to move the required category in the category tree.</p>

<p><b>Aliases:</b></p>
<ul>
	<li>category.move</li>
</ul>



<p><b>Arguments:</b></p>

<table><tbody>
<tr>
<th> Type </th>
<th> Name </th>
<th> Description </th>
</tr>
<tr>
<td> string </td>
<td> sessionId </td>
<td> Session ID </td>
</tr>
<tr>
<td> int </td>
<td> categoryId </td>
<td> ID of the category to be moved </td>
</tr>
<tr>
<td> int </td>
<td> parentId </td>
<td> ID of the new parent category </td>
</tr>
<tr>
<td> string </td>
<td> afterId </td>
<td> ID of the category after which the required category will be moved (optional for V1 and V2) </td>
</tr>
</tbody></table>


<p><b>Returns</b>:</p>

<table><tbody>
<tr>
<th> Type </th>
<th> Name </th>
<th> Description </th>
</tr>
<tr>
<td> boolean </td>
<td> id </td>
<td> True if the category is moved </td>
</tr>
</tbody></table>



<h4><a name="catalog_category.move-Examples"></a>Examples</h4>

<h5><a name="catalog_category.move-RequestExampleSOAPV1"></a>Request Example SOAP V1</h5>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div>
		<pre class="theme: Default; brush: php; gutter: false">$client = new SoapClient('http://magentohost/api/soap/?wsdl');

// If somestuff requires API authentication,
// then get a session token
$session = $client-&gt;login('apiUser', 'apiKey');

$result = $client-&gt;call($session, 'catalog_category.move', array('categoryId' =&gt; '4', 'parentId' =&gt; '3'));
var_dump($result);

// If you don't need the session anymore
//$client-&gt;endSession($session);</pre>
		</div>
</div></div>

<h5><a name="catalog_category.move-RequestExampleSOAPV2"></a>Request Example SOAP V2</h5>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div>
		<pre class="theme: Default; brush: php; gutter: false">$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl'); // TODO : change url
$sessionId = $proxy-&gt;login('apiUser', 'apiKey'); // TODO : change login and pwd if necessary

$result = $proxy-&gt;catalogCategoryMove($sessionId, '4', '3');
var_dump($result);</pre>
		</div>
</div></div>

<h5><a name="catalog_category.move-RequestExampleSOAPV2%28WSIComplianceMode%29"></a>Request Example SOAP V2 (WS-I Compliance Mode)</h5>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<div>
		<pre class="theme: Default; brush: php; gutter: false">$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl');

$sessionId = $proxy-&gt;login((object)array('username' =&gt; 'apiUser', 'apiKey' =&gt; 'apiKey'));

$result = $proxy-&gt;catalogCategoryMove((object)array('sessionId' =&gt; $sessionId-&gt;result, 'categoryId' =&gt; '19', 'parentId' =&gt; '8', 'afterId' =&gt; '4'));
var_dump($result-&gt;result);</pre>
		</div>
</div></div>

<p><b>Note</b>: Please make sure that you are not moving the category to any of its own children. There are no extra checks to prevent doing it through API, and you won’t be able to fix this from the admin interface later.</p>

				    

